define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');
  var tmpl = require('text!../tmpl.html');

  var drag = require('hy5b/frontend/drag/index')
  require('css!hy5b/frontend/drag/drag.css')

  var echarts = require('js/echarts');
  var chinaJson = require('json!npm/echarts/map/json/china.json');
  echarts.registerMap('china', chinaJson);

  var lines = require('v/graph/option/geo-lines')
  var scatter = require('v/graph/option/geo-scatter')
  var style = require('v/graph/option/style')

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);
    $app.append(tmpl);

    var chart = echarts.init(document.getElementById('chart'));
    scatter.geo.roam = false;
    chart.setOption(scatter);

    drag(document.getElementById('box'), function() {
      var width = $('#box').width();
      var height = $('#box').height();
      chart.resize()
    })
  }

  return main;
})
